package com.attendance.www.hr.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.attendance.www.hr.dao.mapper.MainUsersVersionMapper;
import com.attendance.www.hr.entitys.MainUsersNewExample;
import com.attendance.www.hr.entitys.MainUsersVersion;
import com.attendance.www.hr.entitys.MainUsersVersionExample;
import com.attendance.www.hr.service.IMainUsersVersionService;
@Service
public class MainUsersVersionServiceImpl implements IMainUsersVersionService{
	@Resource
	private MainUsersVersionMapper mainUsersVersionDao;
	
	/**
	 * 查询人员版本主数据表
	 */
	@Override
	public List<MainUsersVersion> getMainUsersVersionList() {
		List<MainUsersVersion> mainUsersVersionList = mainUsersVersionDao.selectByExample(new MainUsersVersionExample());
		return mainUsersVersionList;
	}

	/**
	 * 增加人员版本主数据表
	 */
	@Override
	public void saveMainUsersVersion(List<MainUsersVersion> mainUsersVersionList) {
		for (int i = 0; i < mainUsersVersionList.size(); i++) {
			mainUsersVersionDao.insertSelective(mainUsersVersionList.get(i));
		}
	}

	/**
	 * 删除人员版本主数据表
	 */
	@Override
	public boolean deleteMainUsersVersion() {
		if(mainUsersVersionDao.deleteByExample(new MainUsersVersionExample())>0) {
			return true;
		}
		return false;
	}

}
